import { createApp } from "vue";
import { createPinia } from "pinia";

import App from "./App.vue";
import router from "./router";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";

import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";

//引入面包悄组件
import MBX from "@/components/breadClumb.vue";

//import './assets/main.css'

import "normalize.css";
import "@/http/api";

//自动生成svg sprites
import "virtual:svg-icons-register";

import * as filters from "@/filters";

import { quillEditor } from "vue3-quill";

const app = createApp(App);
app.use(quillEditor);

//vue2
//Vue.prototype.$Http=axios

//vue3全局属性配置
app.config.globalProperties.rank = filters.rank;
app.config.globalProperties.dateTime = filters.dateTime;

//遍历图标对象，注册内置所有图标为单独组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

//注册全局面包屑
app.component("MBX", MBX);

app.use(ElementPlus, {
  locale: zhCn,
});

app.use(createPinia());
app.use(router);

app.mount("#app");
